package com.haojiang.mh.remote.bean

import cn.com.heaton.blelibrary.ble.model.BleDevice
import cn.com.heaton.blelibrary.ble.model.ScanRecord

class BleRssiDevice(address: String?, name: String?) :
    BleDevice(address, name), Comparable<BleRssiDevice> {
    private var scanRecords: ScanRecord? = null
    var deviceAlias: String? = null
    var rssi = 0
    var rssiUpdateTime: Long = 0
    var isSend = true

    /*public BleRssiDevice(BleDevice device, ScanRecord scanRecord, int rssi) {
        this.device = device;
        this.scanRecord = scanRecord;
        this.rssi = rssi;
    }*/
    override fun getScanRecord(): ScanRecord {
        return scanRecords!!
    }

    override fun setScanRecord(scanRecord: ScanRecord) {
        this.scanRecords = scanRecord
    }

    override fun toString(): String {
        return "BleRssiDevice(scanRecord=$scanRecords, rssi=$rssi, rssiUpdateTime=$rssiUpdateTime)"
    }

    override fun compareTo(other: BleRssiDevice): Int {
        return other.rssi - this.rssi
    }
}